public abstract class Handler {

    protected Handler nextHandler;  //确定后继
    protected String textMessage;

    //设置传入文本
    public void setTextMessage(String textMessage) {
        this.textMessage = textMessage;
    }


    //后继处理元
    public void setNextHandler(Handler nextHandler) {
        this.nextHandler = nextHandler;
    }

    //构造，用来嵌套职责链
    public Handler(Handler nextHandler){
        this.nextHandler=nextHandler;
    }

    public abstract String handleRequest(String textMessage);
}
